﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Entity;

public partial class Admin_Pages_SizeDelete : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["login"] != null)
            {
                int sizeid = Convert.ToInt32(Request.Params["sizeid"]);
                SizeUI size = new SizeUI();

                int result = size.Delete(sizeid);
                if (result > 0)
                {
                    Response.Write("<script>alert('Delete successful'); window.location='../Pages/SizeList.aspx';</script>");
                }
                else
                {
                    Response.Write("<script>alert('Delete fail'); window.location='../Pages/SizeList.aspx';</script>");
                }     
            }
            else
            {
                Response.Redirect("../Login.aspx");
            }
                 
        }
    }
}
